package com.guet.careapp.service.impl;

import com.guet.careapp.pojo.TServicePosition;
import com.guet.careapp.pojo.TUserInfo;
import com.guet.careapp.service.IPositionService;
import com.guet.careapp.service.base.ServiceSupportImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by LXM on 2017/10/29.
 *
 * @author LXM
 * @version 1.0
 * @description
 * @datetime 15:30
 */
@Service
public class PositionServiceImpl extends ServiceSupportImpl<TServicePosition> implements
        IPositionService {

    @Override
    public List<TServicePosition> findPositionByTime(TUserInfo user, Long time) {

        List<TServicePosition> positions;
        String hql = "SELECT t FROM TServicePosition t WHERE t.userInfoId = " + user.getUId() + " AND t.time > " + time + " ORDER BY t.time DESC";
        positions = queryByHQLWithLimit(hql, 100);
        return positions;
    }

}
